<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Encrypted file transfer: /home/marco/dev/comm/protocol.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Encrypted file transfer
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('protocol_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">protocol.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="protocol_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">protocol.h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">Defines operations on protocols:</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">- listen for incoming connections or user instructions</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">- retrieve right module to be used depending on the required protocol</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">- connect the protocol module to the socket descriptor</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *****************************************/</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;sys/types.h&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;sys/stat.h&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;errno.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;fcntl.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;ctype.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;sys/time.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;time.h&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;features.h&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="protocol_8h.html#a69d5826243a85b53e972f18927e1604e">   20</a></span>&#160;<span class="preprocessor">#define PROTO_LIBRARY_SIZE 4</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="protocol_8h.html#a0efe825fa9e0d0776526bee6f7d830a5">   21</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PROTO_NAME_LENGTH 5</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="protocol_8h.html#a6773b93f3093658c3dcb569de3b4bdb2">   22</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MAX_FILENAME_LENGTH FILENAME_MAX</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="protocol_8h.html#aeca034f67218340ecb2261a22c2f3dcd">   23</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BUFSIZE 512</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="protocol_8h.html#ade4c06414722e68d0198b151bac6439d">   24</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLOCK_ID CLOCK_MONOTONIC</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="protocol_8h.html#a53a45e5bfa8921af754097ee6a02f642">   26</a></span>&#160;<span class="keyword">typedef</span> int (* <a class="code" href="protocol_8h.html#a53a45e5bfa8921af754097ee6a02f642">proto_module_t</a>) (<span class="keywordtype">int</span> socket_descriptor);</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="protocol_8h.html#a51289e64344e52297123cda15008c3bd">   27</a></span>&#160;<span class="keyword">typedef</span> int (* <a class="code" href="protocol_8h.html#a51289e64344e52297123cda15008c3bd">client_module_t</a>) (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * filename);</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="structxprotocol__t.html">   28</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structxprotocol__t.html#af3604d832d344ec65166ad73db7e4bdb">   30</a></span>&#160;  <span class="keywordtype">char</span> proto_name[<a class="code" href="protocol_8h.html#a0efe825fa9e0d0776526bee6f7d830a5">PROTO_NAME_LENGTH</a>];</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="structxprotocol__t.html#a7a553ab2bcc9ba2496f399113256a494">   31</a></span>&#160;  <a class="code" href="protocol_8h.html#a53a45e5bfa8921af754097ee6a02f642">proto_module_t</a> <a class="code" href="structxprotocol__t.html#a7a553ab2bcc9ba2496f399113256a494">proto_module</a>;</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structxprotocol__t.html#ad7c93d9624e91a5d8b6f7bca67a87f65">   32</a></span>&#160;  <a class="code" href="protocol_8h.html#a51289e64344e52297123cda15008c3bd">client_module_t</a> <a class="code" href="structxprotocol__t.html#ad7c93d9624e91a5d8b6f7bca67a87f65">client_module</a>;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;} <a class="code" href="structxprotocol__t.html">xprotocol_t</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="protocol_8h.html#ab9f2c1ca2c8b7d68cafa3713c78ad517">   35</a></span>&#160;<a class="code" href="structxprotocol__t.html">xprotocol_t</a> <a class="code" href="protocol_8h.html#ab9f2c1ca2c8b7d68cafa3713c78ad517">proto_library</a>[<a class="code" href="protocol_8h.html#a69d5826243a85b53e972f18927e1604e">PROTO_LIBRARY_SIZE</a>];</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="protocol_8h.html#a2f08e73819ff416ce3cf1e5143e03071">   36</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a2f08e73819ff416ce3cf1e5143e03071">proto_library_members</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keywordtype">void</span> <a class="code" href="protocol_8h.html#ac851c29c26c03f25155d82adaada4014">proto_get_protocol_code</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keywordtype">char</span> * proto_name);</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<a class="code" href="protocol_8h.html#a53a45e5bfa8921af754097ee6a02f642">proto_module_t</a> <a class="code" href="protocol_8h.html#ab25c6487e37049b4495c8ce9737c2eba">proto_lookup</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * proto_name);</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<a class="code" href="protocol_8h.html#a51289e64344e52297123cda15008c3bd">client_module_t</a> <a class="code" href="protocol_8h.html#aff77cc7594d5e7bf73bba0111201b771">client_lookup</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * proto_name);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="keywordtype">void</span> <a class="code" href="protocol_8h.html#a8c3cd7cda7ec9b4be4d8176a0223244b">proto_init_library</a>();</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">/************************</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">PROTOCOLS</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment"> ************************/</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">//codes: PUT means &quot;put a file on the server&quot;, GET &quot;get a file from the server&quot;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="protocol_8h.html#a9ccbc506509feda9eb5a11b5bd8a66dc">   48</a></span>&#160;<span class="preprocessor">#define PLAIN_PUT &quot;PP000&quot;</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="protocol_8h.html#a06bdb8bc388cbbe0fa88c25697c9b75a">   49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLAIN_GET &quot;PG000&quot;</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="protocol_8h.html#a4a9d8461ddb36f20d32c4113434861ac">   50</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MAOM_PUT &quot;MAOMP&quot;</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="protocol_8h.html#aded3e6ad5111ff8d1fe9994dcf23ed59">   51</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MAOM_GET &quot;MAOMG&quot;</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">/*******************************</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">server modules</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">********************************/</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">//plain file transfer</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#abf4ad03750e4dc1c4fb7ef3dfc603511">proto_plain_put</a> (<span class="keywordtype">int</span> socket_descriptor);  <span class="comment">//PLAIN_PUT</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a4991c680adc37a7841e8a1cc0c6bf993">proto_plain_get</a> (<span class="keywordtype">int</span> socket_descriptor);      <span class="comment">//PLAIN_GET</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">//Massey-Omura file transfer</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#aa017bbd7175269e542630580f737c3cc">maom_get</a>(<span class="keywordtype">int</span> socket_descriptor);             <span class="comment">//MAOM_GET</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#ad46a83933764d43960bacaf3792fa277">maom_put</a>(<span class="keywordtype">int</span> socket_descriptor);             <span class="comment">//MAOM_PUT</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">/**********************************</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment">client modules</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment">***********************************/</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#ab83695a10cb1349b704a5d083cd519d6">client_plain_get</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * filename);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a22f537a1b34dac5b2ffb6064f5082652">client_plain_put</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * filename);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="comment">//Massey - Omura</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a42a5e494db0d8577b4169ffad038f446">client_maom_get</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * filename);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a1f7846943c980060eb26757c155c8c75">client_maom_put</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * filename);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="comment">/*******************************</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="comment">SENDING AND RECEIVING COMMANDS FUNCTIONS</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="comment"> ******************************/</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#adb7d6e26bb22986630d83d48399e8d1f">proto_expect_command</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * command);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a3f6e333d7821f4dc1a2105414a73e259">proto_send_command</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * command);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="keywordtype">void</span> <a class="code" href="protocol_8h.html#ab317a4b5fae174c50e993b8498c682e5">proto_goodbye_failure</a> (<span class="keywordtype">int</span> socket_descriptor, <span class="keyword">const</span> <span class="keywordtype">char</span> * command);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment">/**************************</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="comment">GENERAL COMMANDS AND RESPONSES</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment">commands and responses are 3-digits integers. Range 100-400 is reserved.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment">each protocol may define its own response codes between 401 and 999.</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="comment"> **************************/</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment">//generic</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="protocol_8h.html#ac9dabdb57992a3957027111ff1942c2c">   88</a></span>&#160;<span class="preprocessor">#define CTRL_SIZE 3</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment">//normal 200-100</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="protocol_8h.html#aba51915c87d64af47fb1cc59348961c9">   91</a></span>&#160;<span class="preprocessor">#define OK &quot;100&quot;</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="protocol_8h.html#a8de29f7c8bbf1a81cc6e71ac602032d3">   92</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FILENAME &quot;110&quot;</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="protocol_8h.html#a8049c678a855a57b1030eab386393a8f">   93</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FILESIZE &quot;115&quot;</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="protocol_8h.html#a09c0ab0fcf23a96c1300df12dabb9612">   94</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BEGIN_FILE_TRANSMISSION &quot;120&quot;</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="protocol_8h.html#af10c706d5c35b6fc557c1f5feb5352eb">   95</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define END_FILE_TRANSMISSION &quot;130&quot;</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">//warning 300-201</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="protocol_8h.html#a6918d3c3cf459930ac47e713f064870d">   98</a></span>&#160;<span class="preprocessor">#define GENERAL_WARNING &quot;300&quot;</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="protocol_8h.html#a50dc55ad0c63c1a98915c65ad81962ad">   99</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FILE_CUT_TO_DECLARED_SIZE &quot;290&quot;</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment">//error 400-301</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="protocol_8h.html#acb00992efca56626cdf0907e5edb5b51">  102</a></span>&#160;<span class="preprocessor">#define KO &quot;400&quot;</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="protocol_8h.html#aef113f145ad544ae7347e10a6ca317eb">  103</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PROTOCOL_ERROR &quot;390&quot;</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="protocol_8h.html#abe53049e43e4e79ecf7c4063835c4428">  104</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SERVER_ERROR &quot;380&quot;</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="protocol_8h.html#a00a1b1c25133bb36265f0acf7477e8e2">  105</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FILENAME_LENGTH_ERROR &quot;370&quot;</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="protocol_8h.html#a775241e32b7ccb12e344ae23aa2db6b1">  106</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FILE_NOT_FOUND &quot;360&quot;</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="protocol_8h.html#a7fa617685fe8b2541d118e82c2092328">  107</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLIENT_ERROR &quot;350&quot;</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="comment">/**********************************************</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">GENERAL UTILITY FUNCTIONS</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment">***********************************************/</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#a47f900fbd264cbc9f968d05f83cbfc27">clean_filename</a> (<span class="keywordtype">char</span> * filename);</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="keywordtype">int</span> <a class="code" href="protocol_8h.html#ac363fe1082eefee61957cb913f6b90ca">timespec_subtract</a> (<span class="keyword">struct</span> timespec * result, <span class="keyword">struct</span> timespec * x, <span class="keyword">struct</span> timespec * y);</div>
<div class="ttc" id="protocol_8h_html_a22f537a1b34dac5b2ffb6064f5082652"><div class="ttname"><a href="protocol_8h.html#a22f537a1b34dac5b2ffb6064f5082652">client_plain_put</a></div><div class="ttdeci">int client_plain_put(int socket_descriptor, const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00406">protocol.c:406</a></div></div>
<div class="ttc" id="protocol_8h_html_adb7d6e26bb22986630d83d48399e8d1f"><div class="ttname"><a href="protocol_8h.html#adb7d6e26bb22986630d83d48399e8d1f">proto_expect_command</a></div><div class="ttdeci">int proto_expect_command(int socket_descriptor, const char *command)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00082">protocol.c:82</a></div></div>
<div class="ttc" id="protocol_8h_html_a8c3cd7cda7ec9b4be4d8176a0223244b"><div class="ttname"><a href="protocol_8h.html#a8c3cd7cda7ec9b4be4d8176a0223244b">proto_init_library</a></div><div class="ttdeci">void proto_init_library()</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00011">protocol.c:11</a></div></div>
<div class="ttc" id="protocol_8h_html_a1f7846943c980060eb26757c155c8c75"><div class="ttname"><a href="protocol_8h.html#a1f7846943c980060eb26757c155c8c75">client_maom_put</a></div><div class="ttdeci">int client_maom_put(int socket_descriptor, const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="proto__maom_8c_source.html#l00030">proto_maom.c:30</a></div></div>
<div class="ttc" id="protocol_8h_html_ab317a4b5fae174c50e993b8498c682e5"><div class="ttname"><a href="protocol_8h.html#ab317a4b5fae174c50e993b8498c682e5">proto_goodbye_failure</a></div><div class="ttdeci">void proto_goodbye_failure(int socket_descriptor, const char *command)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00139">protocol.c:139</a></div></div>
<div class="ttc" id="protocol_8h_html_a53a45e5bfa8921af754097ee6a02f642"><div class="ttname"><a href="protocol_8h.html#a53a45e5bfa8921af754097ee6a02f642">proto_module_t</a></div><div class="ttdeci">int(* proto_module_t)(int socket_descriptor)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00026">protocol.h:26</a></div></div>
<div class="ttc" id="protocol_8h_html_a4991c680adc37a7841e8a1cc0c6bf993"><div class="ttname"><a href="protocol_8h.html#a4991c680adc37a7841e8a1cc0c6bf993">proto_plain_get</a></div><div class="ttdeci">int proto_plain_get(int socket_descriptor)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00270">protocol.c:270</a></div></div>
<div class="ttc" id="protocol_8h_html_ab25c6487e37049b4495c8ce9737c2eba"><div class="ttname"><a href="protocol_8h.html#ab25c6487e37049b4495c8ce9737c2eba">proto_lookup</a></div><div class="ttdeci">proto_module_t proto_lookup(const char *proto_name)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00060">protocol.c:60</a></div></div>
<div class="ttc" id="protocol_8h_html_abf4ad03750e4dc1c4fb7ef3dfc603511"><div class="ttname"><a href="protocol_8h.html#abf4ad03750e4dc1c4fb7ef3dfc603511">proto_plain_put</a></div><div class="ttdeci">int proto_plain_put(int socket_descriptor)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00150">protocol.c:150</a></div></div>
<div class="ttc" id="protocol_8h_html_a69d5826243a85b53e972f18927e1604e"><div class="ttname"><a href="protocol_8h.html#a69d5826243a85b53e972f18927e1604e">PROTO_LIBRARY_SIZE</a></div><div class="ttdeci">#define PROTO_LIBRARY_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00020">protocol.h:20</a></div></div>
<div class="ttc" id="protocol_8h_html_a47f900fbd264cbc9f968d05f83cbfc27"><div class="ttname"><a href="protocol_8h.html#a47f900fbd264cbc9f968d05f83cbfc27">clean_filename</a></div><div class="ttdeci">int clean_filename(char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00593">protocol.c:593</a></div></div>
<div class="ttc" id="protocol_8h_html_a42a5e494db0d8577b4169ffad038f446"><div class="ttname"><a href="protocol_8h.html#a42a5e494db0d8577b4169ffad038f446">client_maom_get</a></div><div class="ttdeci">int client_maom_get(int socket_descriptor, const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="proto__maom_8c_source.html#l00026">proto_maom.c:26</a></div></div>
<div class="ttc" id="protocol_8h_html_ac363fe1082eefee61957cb913f6b90ca"><div class="ttname"><a href="protocol_8h.html#ac363fe1082eefee61957cb913f6b90ca">timespec_subtract</a></div><div class="ttdeci">int timespec_subtract(struct timespec *result, struct timespec *x, struct timespec *y)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00611">protocol.c:611</a></div></div>
<div class="ttc" id="structxprotocol__t_html"><div class="ttname"><a href="structxprotocol__t.html">xprotocol_t</a></div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00028">protocol.h:28</a></div></div>
<div class="ttc" id="structxprotocol__t_html_a7a553ab2bcc9ba2496f399113256a494"><div class="ttname"><a href="structxprotocol__t.html#a7a553ab2bcc9ba2496f399113256a494">xprotocol_t::proto_module</a></div><div class="ttdeci">proto_module_t proto_module</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00031">protocol.h:31</a></div></div>
<div class="ttc" id="protocol_8h_html_a0efe825fa9e0d0776526bee6f7d830a5"><div class="ttname"><a href="protocol_8h.html#a0efe825fa9e0d0776526bee6f7d830a5">PROTO_NAME_LENGTH</a></div><div class="ttdeci">#define PROTO_NAME_LENGTH</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00021">protocol.h:21</a></div></div>
<div class="ttc" id="protocol_8h_html_aa017bbd7175269e542630580f737c3cc"><div class="ttname"><a href="protocol_8h.html#aa017bbd7175269e542630580f737c3cc">maom_get</a></div><div class="ttdeci">int maom_get(int socket_descriptor)</div><div class="ttdef"><b>Definition:</b> <a href="proto__maom_8c_source.html#l00008">proto_maom.c:8</a></div></div>
<div class="ttc" id="protocol_8h_html_a2f08e73819ff416ce3cf1e5143e03071"><div class="ttname"><a href="protocol_8h.html#a2f08e73819ff416ce3cf1e5143e03071">proto_library_members</a></div><div class="ttdeci">int proto_library_members</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00036">protocol.h:36</a></div></div>
<div class="ttc" id="protocol_8h_html_aff77cc7594d5e7bf73bba0111201b771"><div class="ttname"><a href="protocol_8h.html#aff77cc7594d5e7bf73bba0111201b771">client_lookup</a></div><div class="ttdeci">client_module_t client_lookup(const char *proto_name)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00071">protocol.c:71</a></div></div>
<div class="ttc" id="protocol_8h_html_ad46a83933764d43960bacaf3792fa277"><div class="ttname"><a href="protocol_8h.html#ad46a83933764d43960bacaf3792fa277">maom_put</a></div><div class="ttdeci">int maom_put(int socket_descriptor)</div><div class="ttdef"><b>Definition:</b> <a href="proto__maom_8c_source.html#l00018">proto_maom.c:18</a></div></div>
<div class="ttc" id="protocol_8h_html_a51289e64344e52297123cda15008c3bd"><div class="ttname"><a href="protocol_8h.html#a51289e64344e52297123cda15008c3bd">client_module_t</a></div><div class="ttdeci">int(* client_module_t)(int socket_descriptor, const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00027">protocol.h:27</a></div></div>
<div class="ttc" id="protocol_8h_html_ac851c29c26c03f25155d82adaada4014"><div class="ttname"><a href="protocol_8h.html#ac851c29c26c03f25155d82adaada4014">proto_get_protocol_code</a></div><div class="ttdeci">void proto_get_protocol_code(int socket_descriptor, char *proto_name)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00027">protocol.c:27</a></div></div>
<div class="ttc" id="protocol_8h_html_ab83695a10cb1349b704a5d083cd519d6"><div class="ttname"><a href="protocol_8h.html#ab83695a10cb1349b704a5d083cd519d6">client_plain_get</a></div><div class="ttdeci">int client_plain_get(int socket_descriptor, const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00481">protocol.c:481</a></div></div>
<div class="ttc" id="structxprotocol__t_html_ad7c93d9624e91a5d8b6f7bca67a87f65"><div class="ttname"><a href="structxprotocol__t.html#ad7c93d9624e91a5d8b6f7bca67a87f65">xprotocol_t::client_module</a></div><div class="ttdeci">client_module_t client_module</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00032">protocol.h:32</a></div></div>
<div class="ttc" id="protocol_8h_html_a3f6e333d7821f4dc1a2105414a73e259"><div class="ttname"><a href="protocol_8h.html#a3f6e333d7821f4dc1a2105414a73e259">proto_send_command</a></div><div class="ttdeci">int proto_send_command(int socket_descriptor, const char *command)</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8c_source.html#l00124">protocol.c:124</a></div></div>
<div class="ttc" id="protocol_8h_html_ab9f2c1ca2c8b7d68cafa3713c78ad517"><div class="ttname"><a href="protocol_8h.html#ab9f2c1ca2c8b7d68cafa3713c78ad517">proto_library</a></div><div class="ttdeci">xprotocol_t proto_library[PROTO_LIBRARY_SIZE]</div><div class="ttdef"><b>Definition:</b> <a href="protocol_8h_source.html#l00035">protocol.h:35</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_48915bc83c3e9a2c33920cc086982b8a.html">comm</a></li><li class="navelem"><a class="el" href="protocol_8h.html">protocol.h</a></li>
    <li class="footer">Generated on Sun Nov 16 2014 15:38:22 for Encrypted file transfer by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
